﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using System.Runtime.InteropServices;
using Lamex.mNC.Common;
using System.Diagnostics;

namespace Lamex.mNC.UI
{
    public partial class frmNC_Convert_DKSJR_Checking : frmBaseChild
    {
        IntPtr handle;
        [DllImport("user32.dll", SetLastError = true)]

        private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

        private const int GWL_STYLE = (-16);
        private const int WS_VISIBLE = 0x10000000;
        const Int32 WS_BORDER = (Int32)0x00800000L;
        const Int32 WS_THICKFRAME = (Int32)0x00040000L;
        const Int32 SWP_NOMOVE = 0x0002;
        const Int32 SWP_NOSIZE = 0x0001;
        const Int32 SWP_NOZORDER = 0x0004;
        const Int32 SWP_FRAMECHANGED = 0x0020;
        const Int32 SW_MAXIMIZE = 3;
        IntPtr HWND_NOTOPMOST = new IntPtr(-2);
        //[DllImport("user32.dll", EntryPoint = "SetWindowLongA", SetLastError = true, CallingConvention = CallingConvention.Cdecl)]
        //private static extern long SetWindowLong(IntPtr hwnd, int nIndex, long dwNewLong);
        [DllImport("user32", EntryPoint = "SetWindowLong", SetLastError = true)]
        private static extern uint SetWindowLong(
        IntPtr hwnd,
        int nIndex,
        int dwNewLong
        );
        [DllImport("user32.dll", EntryPoint = "FindWindow")]
        private extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
        [DllImport("user32.dll")]
        static extern Int32 SetWindowPos(IntPtr hWnd,
   IntPtr hWndInsertAfter,
   Int32 X,
   Int32 Y,
   Int32 cx,
   Int32 cy,
   UInt32 uFlags
 );
        public frmNC_Convert_DKSJR_Checking()
        {
            InitializeComponent();
            Process[] ps = Process.GetProcessesByName("acad");
            if(ps.Length!=0)
            {
                IntPtr hwnd = ps[0].MainWindowHandle;
                InsertWindow insertwin = new InsertWindow(panel1, "", hwnd);
            }
            
        }

        private void frmNC_Convert_DKSJR_Checking_Resize(object sender, EventArgs e)
        {
            splitContainerControl1.SplitterPosition = this.Width / 2;
        }

        private void sbtnRefresh_Click(object sender, EventArgs e)
        {

        }
    }
}